from sqlalchemy import Table, Integer, Column, ForeignKey

from api.db.config import Base

post_category = Table(
    "post_category",
    Base.metadata,
    # 两字段primary_key都等于True，组合主键唯一，防止内容一样
    Column("post_id", Integer, ForeignKey("Post.id"), primary_key=True),
    Column("category_id", Integer, ForeignKey("Category.id"), primary_key=True),
)
